<template>
  <div class="aime-init-content">
    <div class="icon">
      <img :src="icon" alt="" />
      <div class="title">{{ title }}</div>
    </div>
    <AimeDialogBox :content="greeting" :needControls="false" :needAnalyzeStatus="false"/>
    <div v-if="recommendContents && recommendContents.length" class="recommend-contents">
      <AimeDialogBox
        v-for="(recommendContent, index) in recommendContents"
        :key="index"
        :needControls="false"
        :needAnalyzeStatus="false"
        type="recommend"
        :needTypeWriter="false"
        :content="recommendContent"
        @click.native="clickRecommendContent(recommendContent)"
      />
    </div>
  </div>
</template>

<script>
import AimeDialogBox from './AimeDialogBox.vue';
export default {
  name: 'AimeInitContent',
  components: {
    AimeDialogBox
  },
  props: {
    icon: {
      type: String,
      default: '',
      required: false
    },
    title: {
      type: String,
      default: '',
      required: true
    },
    // 欢迎语
    greeting: {
      type: String,
      default: '',
      required: true
    },
    // 推荐内容
    recommendContents: {
      type: Array,
      default: () => [],
      required: false
    }
  },
  methods: {
    clickRecommendContent(recommendContent) {
      this.$emit('clickRecommendContent', recommendContent);
    }
  }
};
</script>
<style lang="less" scoped>
.aime-init-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 24px 16px;
  .icon {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    img {
      width: 100px;
      height: 100px;
    }
    .title {
      font-family: PingFangSC-Regular;
      font-size: 16px;
      color: #a1a1b3;
      text-align: center;
      line-height: 24px;
      font-weight: 400;
      margin-top: 16px;
    }
  }
  .recommend-contents {
    margin-top: 8px;
  }
}
</style>
